from dataclasses import asdict

import pinia
from console_conpent.select import select
from effect.util.console.SuperConsole import cls
from effect.util.console.playerdata_print import pprint
from effect.util.console.showMySlave import ShowMySlave
from entiys.npc.NPCLoader import NPCLoader
from game.TopClass.withSaveInfo import WithSaveInfoWindows
from game_control.save.saveManager import SaveManager


class SlaveManager(WithSaveInfoWindows):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.slaves = []

    def UiShow(self):
        cls()
        pd = asdict(self.playerdata)
        choose  = ShowMySlave.choose(savename=self.savename, playername=self.playerdata.saveJson.get("playername"))
        slaveName = choose.getvalue()

        if choose.getindex() == 0:
            self.LastWindows.UiShow()
        else:
            """
            选择的 奴隶
            """
            saveMager: SaveManager = pinia.store.get("savemanager")
            saveMager.loadSave()
    def Logic(self):
        ...

